<?php
$table = "user";
$query = mysql_query("select count(nid) from $table");
$sum = mysql_result($query, 0);
$result = mysql_query("select * from $table order by user_id");
while ($row = mysql_fetch_array($result)) {
    $admin_nid[] = $row['nid'];
    $admin_user_id[] = $row['user_id'];
    $admin_user_name[] = $row['user_name'];
    $admin_user_term[] = $row['user_term'];
    $admin_department[] = $row['department'];
    $admin_balance[] = $row['balance'];
}
?>